package com.study.juc;

import java.util.concurrent.ArrayBlockingQueue;

public class BlockedQueue {
    public static void main(String[] args) {
        ArrayBlockingQueue<String> arrayBlockingQueue = new ArrayBlockingQueue<>(10, false);
        for (int i = 0; i < 10; i++) {
            arrayBlockingQueue.add("aaaa" + i);
        }

        for (int i = 0; i < 10; i++) {
            String poll = arrayBlockingQueue.poll();
            System.out.println("poll = " + poll);
        }

    }
}
